import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import api from '@/api'
import storage from '@/utils/storage'

import {
  Button,
  Tabbar, TabbarItem,
  Swipe, SwipeItem,
  Search,
  Lazyload,
  NavBar,
  Popup,
  Toast,
  Loading,
  Tab, Tabs,
  PullRefresh
} from 'vant'

// local
import '@/directives'
import '@/styles/index.scss'
import '@/icons/'
import '@/components/'
import MLoading from '@/components/common/loading'

// swiper
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/swiper-bundle.css'
// virtual-scroller
import { RecycleScroller } from 'vue-virtual-scroller'
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'

Vue.component('RecycleScroller', RecycleScroller)
Vue.use(VueAwesomeSwiper)
Vue.use(MLoading)

// vant
Vue.use(PullRefresh)
Vue.use(Lazyload)
Vue.use(Popup)
Vue.use(NavBar)
Vue.use(Search)
Vue.use(Swipe)
Vue.use(SwipeItem)
Vue.use(Button)
Vue.use(Tabbar)
Vue.use(TabbarItem)
Vue.use(Toast)
Vue.use(Loading)
Vue.use(Tab)
Vue.use(Tabs)

// 扩展 Vue
Vue.prototype.$api = api
Vue.prototype.$storage = storage
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
